package com.eco.fanliapp.exception;

import com.eco.fanliapp.common.response.ServerResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 描述：
 * <p>
 *
 * @author: 赵新国
 * @date: 2018/4/11 23:06
 */
public class BaseException extends RuntimeException {

	private static final long serialVersionUID = -5588438592559863953L;

	public BaseException(String message) {
        super(message);
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }
    
    @ExceptionHandler(value = RuntimeException.class)
    @ResponseBody
    public ServerResponse<String> errorHandler9(RuntimeException ex) {
        return ServerResponse.createByErrorCodeMessage(403,ex.getMessage());
    }
}

